package cn.yll.web.config;

import cn.yll.api.conf.WebMvcConfig;
import com.alibaba.cloud.seata.web.SeataHandlerInterceptor;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;

/**
 * 配置接口权限检查拦截器
 * @author yangll
 */
@Component
public class WebConfig extends WebMvcConfig {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //登录权限检查拦截器
        registry.addInterceptor(new UserLoginInterceptor()).addPathPatterns("/**").excludePathPatterns("/error", "/favicon.icon", "/doc.html", "/swagger*/**", "/v2/**");
        registry.addInterceptor(new SeataHandlerInterceptor()).addPathPatterns("/**");
    }
}
